# 请求 & 响应模型
from pydantic import BaseModel


class UserCreate(BaseModel):
    username: str
    password: str


class UserOut(BaseModel):
    id: int
    username: str

    class Config:
        # 写法1：
        # orm_mode = True
        model_config = {
            "from_attributes": True
        }